        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>Color3 class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="Color3">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/Color3.html">Color3</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>Color3</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class Color3 {
 int x;
 int y;
 int z;

 Color3() : x = 0, y = 0, z = 0;
 Color3.fromRGB(int r, int g, int b) : x = r, y = g, z = b;
 Color3.fromRGBF(double r, double g, double b)
     : x = (r * 255).floor().toInt(),
       y = (g * 255).floor().toInt(),
       z = (b * 255).floor().toInt();
 Color3.fromColor3(Color3 color)
     : x = color.x, y = color.y, z = color.z;

 void setFromRGB(int r, int g, int b) {
   x = r; y = g; z = b;
 }

 void setFromRGBF(double r, double g, double b) {
   x = (r * 255).floor().toInt();
   y = (g * 255).floor().toInt();
   z = (b * 255).floor().toInt();
 }

 void setFromColor3(Color3 color) {
   x = color.x;
   y = color.y;
   z = color.z;
 }

 bool operator ==(final other) {
   return other is Color3 &amp;&amp; x == other.x &amp;&amp; y == other.y &amp;&amp; z == other.z;
 }
}
</pre>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="Color3">
<button class="show-code">Code</button>
new <strong>Color3</strong>() <a class="anchor-link" href="#Color3"
              title="Permalink to Color3.Color3">#</a></h4>
<div class="doc">
<pre class="source">
Color3() : x = 0, y = 0, z = 0;
</pre>
</div>
</div>
<div class="method"><h4 id="Color3.fromColor3">
<button class="show-code">Code</button>
new <strong>Color3.fromColor3</strong>(<a href="../box2d/Color3.html">Color3</a> color) <a class="anchor-link" href="#Color3.fromColor3"
              title="Permalink to Color3.Color3.fromColor3">#</a></h4>
<div class="doc">
<pre class="source">
Color3.fromColor3(Color3 color)
   : x = color.x, y = color.y, z = color.z;
</pre>
</div>
</div>
<div class="method"><h4 id="Color3.fromRGB">
<button class="show-code">Code</button>
new <strong>Color3.fromRGB</strong>(int r, int g, int b) <a class="anchor-link" href="#Color3.fromRGB"
              title="Permalink to Color3.Color3.fromRGB">#</a></h4>
<div class="doc">
<pre class="source">
Color3.fromRGB(int r, int g, int b) : x = r, y = g, z = b;
</pre>
</div>
</div>
<div class="method"><h4 id="Color3.fromRGBF">
<button class="show-code">Code</button>
new <strong>Color3.fromRGBF</strong>(double r, double g, double b) <a class="anchor-link" href="#Color3.fromRGBF"
              title="Permalink to Color3.Color3.fromRGBF">#</a></h4>
<div class="doc">
<pre class="source">
Color3.fromRGBF(double r, double g, double b)
   : x = (r * 255).floor().toInt(),
     y = (g * 255).floor().toInt(),
     z = (b * 255).floor().toInt();
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="x">
<button class="show-code">Code</button>
int         <strong>x</strong> <a class="anchor-link"
            href="#x"
            title="Permalink to Color3.x">#</a>
        </h4>
        <div class="doc">
<pre class="source">
x
</pre>
</div>
</div>
<div class="field"><h4 id="y">
<button class="show-code">Code</button>
int         <strong>y</strong> <a class="anchor-link"
            href="#y"
            title="Permalink to Color3.y">#</a>
        </h4>
        <div class="doc">
<pre class="source">
y
</pre>
</div>
</div>
<div class="field"><h4 id="z">
<button class="show-code">Code</button>
int         <strong>z</strong> <a class="anchor-link"
            href="#z"
            title="Permalink to Color3.z">#</a>
        </h4>
        <div class="doc">
<pre class="source">
z
</pre>
</div>
</div>
</div>
<div>
<h3>Operators</h3>
<div class="method"><h4 id="==">
<button class="show-code">Code</button>
bool <strong>operator ==</strong>(other) <a class="anchor-link" href="#=="
              title="Permalink to Color3.operator ==">#</a></h4>
<div class="doc">
<div class="inherited">
<p>The equality operator.</p>
<p>The default behavior for all <code>Object</code>s is to return true if and
only if <code>this</code> and 
<span class="param">other</span> are the same object.</p>
<p>If a subclass overrides the equality operator it should override
the <code>hashCode</code> method as well to maintain consistency.</p>
<div class="docs-inherited-from">docs inherited from Object </div></div>
<pre class="source">
bool operator ==(final other) {
 return other is Color3 &amp;&amp; x == other.x &amp;&amp; y == other.y &amp;&amp; z == other.z;
}
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="setFromColor3">
<button class="show-code">Code</button>
void <strong>setFromColor3</strong>(<a href="../box2d/Color3.html">Color3</a> color) <a class="anchor-link" href="#setFromColor3"
              title="Permalink to Color3.setFromColor3">#</a></h4>
<div class="doc">
<pre class="source">
void setFromColor3(Color3 color) {
 x = color.x;
 y = color.y;
 z = color.z;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setFromRGB">
<button class="show-code">Code</button>
void <strong>setFromRGB</strong>(int r, int g, int b) <a class="anchor-link" href="#setFromRGB"
              title="Permalink to Color3.setFromRGB">#</a></h4>
<div class="doc">
<pre class="source">
void setFromRGB(int r, int g, int b) {
 x = r; y = g; z = b;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setFromRGBF">
<button class="show-code">Code</button>
void <strong>setFromRGBF</strong>(double r, double g, double b) <a class="anchor-link" href="#setFromRGBF"
              title="Permalink to Color3.setFromRGBF">#</a></h4>
<div class="doc">
<pre class="source">
void setFromRGBF(double r, double g, double b) {
 x = (r * 255).floor().toInt();
 y = (g * 255).floor().toInt();
 z = (b * 255).floor().toInt();
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
